home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 4 / The 640 Meg Shareware Studio CD-ROM Volume IV (Data Express)(1994).ISO / clang / 3d_lib.zip / XF.C < prev    next >
C/C++ Source or Header  |  1993-05-09  |  914b  |  36 lines

  1. /* Transform object
  2.  
  3.    Copyright (c) 1988 by Gus O'Donnell
  4.  
  5.    Revision history:
  6.  
  7.    Version 1.00         February 29, 1988       As released.
  8.  
  9.    Version 1.01         March 20, 1988          Created libraries for all
  10.                                                 memory models
  11.  
  12. */
  13. #include "3d.h"
  14. #include <float.h>
  15. #include <math.h>
  16. #include <stdio.h>
  17.  
  18. int     xform (OBJECT this_obj, MATRIX transform)
  19.  
  20. /*  Transform an object.  This function transforms an object from one
  21. coordinate system to another as specified by the transform matrix.
  22. Each vertex in the vertex list is multiplied by the transformation matrix.
  23. */
  24.  
  25. {
  26.     VERTEX *vhandle;    /* Pointer to traverse the vertex list */
  27.  
  28.     vhandle = this_obj.vertices -> next;
  29.     while (vhandle -> next != NULL)
  30.     {
  31.         vec_mul (vhandle, transform, vhandle);
  32.         vhandle = vhandle -> next;
  33.     }
  34.     return(0);
  35. }
  36.